var iDiffX=0;
var iDiffY=0;
var moveDiv;
function handleMouseDown(moveDivName)
{
   if(event.button!=2)
   {
     moveDiv=moveDivName;
     document.body.attachEvent("onmousemove",handleMouseMove);
     document.body.attachEvent("onmouseup",handleMouseUp);
     
     var oDiv;
     if(null!=getBarDiv().all.namedItem(moveDiv))
     {oDiv=getBarDiv().all.namedItem(moveDiv);}
     else
     {oDiv=document.getElementById(moveDiv)}
    
     iDiffX=event.clientX-oDiv.offsetLeft;
     iDiffY=event.clientY-oDiv.offsetTop;
   }
}
function handleMouseMove()
{ 
    var oDiv;
    if(null!=getBarDiv().all.namedItem(moveDiv))
    {oDiv=getBarDiv().all.namedItem(moveDiv);}
    else
    {oDiv=document.getElementById(moveDiv)}
     
    var x=event.clientX-iDiffX;
    var y=event.clientY-iDiffY;
    oDiv.style.left=x;
    oDiv.style.top=y;
    event.returnValue = false;
}
function handleMouseUp()
{
    document.body.detachEvent("onmousemove",handleMouseMove);
    document.body.detachEvent("onmouseup",handleMouseUp);
}